package br.com.felipeab.dexter.bean;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import br.com.felipeab.dexter.bo.PersistenceService;
import br.com.felipeab.dexter.domain.Evento;
import br.com.felipeab.dexter.faces.CrudController;

@ViewScoped
@ManagedBean(name = "eventoBean")
public class EventoBean extends CrudController<Evento> {

	private static final long serialVersionUID = -4774552639431620329L;

	private Evento evento;
	private PersistenceService persistenceService;

	@Override
	protected PersistenceService getPersistenceService() {
		if (persistenceService == null) {
			persistenceService = new PersistenceService();
		}
		return persistenceService;
	}

	@Override
	public Evento getDomain() {
		if (evento == null) {
			evento = new Evento();
		}
		return evento;
	}

	@Override
	public void setDomain(Evento evento) {
		this.evento = evento;
	}
}
